<?php

class HTML_TableElements_TableHead extends TableElements implements HTMLElements  {
	
	const HTML_TABLEHEAD = 'th';
	
	/**
	 * 
	 * This function creates a complete Link-Element.
	 * The attributes have to be passed within an array. Possible attributes are:
	 * 	- $class
	 * 	- $id
	 * 	- $title
	 *  - $rowspan
	 *  - $colspan
	 * @param unknown_type $parent
	 * @param String[][] $properties
	 */
	public function __construct($parent, $properties)  {
		PropertySetter::setProperties($this, $properties);
		$parent->addChildElement($this);
	}
	
	public static function getAttributes ()  {
		return parent::getAttributes();
	}
	
	public function toString ()  {
		
		$output = '';
		
		if($this->getChildElements())  {
			foreach ($this->getChildElements() as $element)  {
				$output .= '<'. self::HTML_TABLEHEAD.
							$this->getHTMLAttributes().
							$this->getTableElementsAttributes(). '>';
							
				$output .= $element->toString();
				$output .= '</'. self::HTML_TABLEHEAD. '>';
			}
		}
		
		return $output;
	}
	
}